###################################################
## 1、得到pyclone的输入
rm -rf ${Pyclone_path}/Input_all
mkdir -p ${Pyclone_path}/Input_all
for samples in ` cat ${config_path}/tumor_normal.all.list | grep -v Normal ` 
do
echo $samples
Tumor=` echo $samples | awk -F, '{print$1}' `
Normal=` echo $samples | awk -F, '{print$2}' `
Class=`cat ${config_path}/tumor_normal.class.list | grep -w ${Tumor} | awk '{print $5}'`
sh ${scripts_path}/pyclone/Pyclone_1_GetInput.sh ${Tumor} ${Normal} ${Class}
done

###################################################
## 2、运行Pyclone
## 单个样本计算计算克隆结构用于mutationTime，mutationTimeR也是单样本去算的
## IM的突变数量过少，和GC共有的突变去推测克隆结构会导致没有足够数量的突变
export Type=All
mkdir -p ${Pyclone_path}/result/${Type}
for Tumor in ` cat ${config_path}/tumor_normal.all.list |  grep -v Normal | awk -F, '{print $1}'| sort -u ` 
do
echo " sh ${scripts_path}/pyclone/Pyclone_2_Run.SingleSample.sh ${Tumor} ${config_path} ${Type}" | \
qsub -N ${Tumor}_"Pyclone" -l nodes=1:ppn=4,mem=10gb,walltime=240:00:00 -q smp -d ${Qsub_log_path}
done
